cmake_minimum_required(VERSION 3.10)

cmake_policy(SET CMP0074 NEW)
find_package(Boost REQUIRED COMPONENTS program_options system date_time)

include_directories(${Boost_INCLUDE_DIRS})

link_directories(${LIBRARY_OUTPUT_PATH})

aux_source_directory(src SRC)

add_executable(telegram ${SRC})

DB_SELECT(telegram)

if(WIN32)
    target_link_libraries(telegram osprotocol protocol scada dmos osdb options oslog osmsg osascom oscom string misc env tinyxml json ${Boost_LIBRARIES})
else()
    target_link_libraries(telegram osprotocol protocol scada dmos osdb options oslog osmsg osascom oscom osio string misc env tinyxml json ${Boost_LIBRARIES} rt)
endif()

install(TARGETS telegram RUNTIME)